<%
var headContent = {
include("/pages/template/head.html"){}
%>

<script type="text/javascript">

    var oper;
    jQuery(function ($) {
        // 页面方法
        oper = {
            width: 400,
            height: 450,
            form: document.form1,
            list: function () {
                var url = 'system/sysauth/list';
                this.form.action = url;
                this.form.submit();
            },
            add: function () {
                var url = 'system/sysauth/add';
                var title = '添加';
                Iframe(url, this.width, this.height, title);
            },
            edit: function (id) {
                var url = 'system/sysauth/edit/' + id;
                var title = '修改';
                Iframe(url, this.width, this.height, title);
            },
            del: function (id) {
                var url = 'system/sysauth/delete/' + id;
                var title = '确认要删除该信息？';
                Confirm(title, function () {
                    form1.action = url;
                    form1.submit();
                });
            }
        };
        //显示Menu索引
        showMenu('page_auth');
    });

    //分页
    var paginator = function (page) {
        oper.list();
    };
</script>

<%
};

var bodyContent = {
%>
<form name="form1" action="" method="post" class="form-inline" role="form">
    <!-- 菜单 -->
    <% include("/pages/template/menu.html"){} %>

    <div class="tableSearch">
        <% //查询列表 %>

        <div class="form-group">
            <input class="form-control" type="text" name="attr.descript" value="${attr.descript!''}"
                   placeholder="---请输功能描述---" autocomplete="off"/>
        </div>

        <div class="form-group">
            <select name="attr.is_halt" class="form-control">
                <option value="-1">---请选状态---</option>
                <option value="F" ${attr.is_halt=='F'?"selected":"" }>否</option>
                <option value="T" ${attr.is_halt=='T'?"selected":"" }>是</option>
            </select>
        </div>

        <button type="button" class="btn btn-default" onclick="oper.list();" name="search">
            <span class="glyphicon glyphicon-search"></span> 查 询
        </button>
        <button type="button" class="btn btn-default" onclick="resetForm();">
            <span class="glyphicon glyphicon-refresh"></span> 重 置
        </button>
        <button type="button" class="btn btn-default" onclick="oper.add();">
            <span class="glyphicon glyphicon-plus"></span> 新 增
        </button>
    </div>

    <!-- 数据列表 -->
    <table class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th width="4%">序号</th>
            <th name="uri" class="sorting">uri</th>
            <th name="descript" class="sorting">功能描述</th>
            <th width="7%" name="is_halt" class="sorting">是否停用</th>
            <th width="10%" name="create_datetime" class="sorting">创建时间</th>
            <th width="10%" name="modify_datetime" class="sorting">更新时间</th>
            <th colspan="2">操作</th>
        </tr>
        </thead>
        <tbody>
        <% for(item in page.list){ %>
        <tr>
            <td>${itemLP.index }</td>
            <% // 列表内容 %>
            <td>${item.uri!}</td>
            <td>${item.descript!}</td>
            <td>
            <% if(item.is_halt == 'F') { %>
            否
            <%} else if(item.is_halt == 'T') {%>
            是
            <% } %>
            </td>
            <td>${flyfox.timestampToDate(item.create_datetime)}</td>
            <td>${flyfox.timestampToDate(item.modify_datetime)}</td>
            <td width="30">
                <a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.edit('${item.id}');">修改</a>
            </td>
            <td width="30">
                <a href="javascript:void(0);" class="btn btn-sm btn-danger" onclick="oper.del('${item.id}');">删除</a>
            </td>
        </tr>
        <% } %>
        </tbody>
    </table>
    <%include("/pages/includes/paginator.html"){} %>
</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>
